package cn.fengshenghospital.controller;

import cn.fengshenghospital.entity.Imgs;
import cn.fengshenghospital.service.ImgsService;
import cn.fengshenghospital.vo.JsonBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/imgs")
public class ImgsController {
    @Autowired
    private ImgsService imgsService;
    @RequestMapping("/queryImgsByDtype")
    @ResponseBody
    public JsonBean queryImgsByDtype(int did){
        List<Imgs> imgList = imgsService.queryImgs(did);
        JsonBean<List<Imgs>> jsonBean = new JsonBean<>("queryImgsByDtype");
        if (imgList!=null){
            jsonBean.setStatus(200);
            jsonBean.setData(imgList);
        }else{
            jsonBean.setStatus(-1);
        }
        return jsonBean;
    }
}
